package iotwisp.school.area.entity;

import iotwisp.base.orm.StringIdBaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

@SuppressWarnings("serial")
@Data
@EqualsAndHashCode(callSuper = false)
@DynamicUpdate
@DynamicInsert
@Entity
@Table(name = M.TABLE_PREFIX + "scene")
public class Scene extends StringIdBaseEntity {

    /**
     * 哪个区域的场景
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "area_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private Area area;

    /**
     * 场景名称: 阅览室白天开放状态
     */
    @Column(name = "name", length = 32)
    private String name;

    /**
     * 场景描述：
     */
    @Column(name = "description", length = 256)
    private String description;
}
